import { resultPageSuccess, resultSuccess } from "mock/_util";
import { MockMethod } from "vite-plugin-mock";

function getLectureRecordList() {
  const list: any[] = [];
  for (let i = 0; i < 30; i++) {
    list.push({
      noteId: i,
      className: `${i}班`,
      startDate: "2022-08-20",
      docLink: "http://localhost:3300/static/upload/favicon.ico",
      experience: `体会与建议——${i}`,
      groupEvaluation: `小组评价——${i}`,
      lectureType: "类型1",
      personalSummary: `个人总结——${i}`,
      teacherName: `宋浩--${i}`,
      teachingProcess: `听课过程——${i}`,
      lectureContent: `这是一条听课内容——${i}`,
    });
  }
  return list;
}

export default [
  {
    url: "/dev-api/lectureNote/page",
    timeout: 100,
    method: "get",
    response: ({ query }) => {
      const { pageNum = 1, pageSize = 10 } = query;
      return resultPageSuccess(pageNum, pageSize, getLectureRecordList());
    },
  },
  {
    url: "/dev-api/lectureNote/page/:userId",
    timeout: 100,
    method: "get",
    response: ({ query }) => {
      const { pageNum = 1, pageSize = 10 } = query;
      return resultPageSuccess(pageNum, pageSize, getLectureRecordList());
    },
  },
  {
    url: "/dev-api/lectureNote/setRemark/:userId/:planId",
    timeout: 100,
    method: "put",
    response: () => {
      return resultSuccess({});
    },
  },
] as MockMethod[];
